﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QLCONGNOLIBS.Models.DungDD_Models;
using QLCONGNOLIBS.Securities.DungDD_SecurityFramework;

namespace QLCONGNOLIBS.Controllers.DungDD_Controller
{
    public class UserControllerNew
    {
        // datafield
        private SqlConnection objSqlConnection_g;
        private tblUser_SC objUserEntity_g;
        private UserModelNew objModelNew;

        public UserControllerNew(SqlConnection objConnection, tblUser_SC objUser)
        {
            objSqlConnection_g = objConnection;
            objUserEntity_g = objUser;
            objModelNew = new UserModelNew(objSqlConnection_g, objUserEntity_g);
        }

        public DataTable CheckLogin(string userName, string passWord)
        {
            return objModelNew.CheckElement(userName, passWord);
        }

        public bool Validate_Username_Email_C(string username_p, string email_p)
        {
            return objModelNew.Validate_Username_Email_m(username_p, email_p);
        }

        public bool ChangePasswordUser_C(string username_p, string password_p)
        {
            return objModelNew.ChangePasswordUser_m(username_p, password_p);
        }
    }
}
